package com.fjec.common.redis;

import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.Scheduled;

@Slf4j
public class Timer {

    private RedisGenIdHelper redisGenIdHelper;

    public Timer(RedisGenIdHelper redisGenIdHelper) {
        this.redisGenIdHelper = redisGenIdHelper;
    }

    /**
     * 每10分钟执行一次
     */
    @Scheduled(cron = "0 0/10 * * * *")
    public void loopCheck() {
        redisGenIdHelper.loopCheck();
        log.info("Loop check, seed=[{}]", RedisGenIdHelper.getSeed());
    }

//    @Scheduled(cron = "0/10 * * * * *")
//    public void test() {
//        log.info("test");
//    }
}
